package com.funtonow.jqdk.ui;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.funtonow.jqdk.R;
import com.funtonow.jqdk.base.BaseActivity;
import com.funtonow.jqdk.base.Constants;
import com.funtonow.jqdk.utils.AppUtils;
import com.funtonow.jqdk.utils.StatisticsUtils;
import com.funtonow.jqdk.utils.UiUtils;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * @author Airsaid
 * @date 2017/4/12
 * @desc 设置 Activity
 */
public class SettingActivity extends BaseActivity implements View.OnClickListener {


    @BindView(R.id.txt_slogan)
    TextView mTxtSlogan;
    @BindView(R.id.txt_version)
    TextView mTxtVersion;
    @BindView(R.id.tv_desc)
    TextView tvDesc;
    @BindView(R.id.ll_ht)
    LinearLayout llHt;
    @BindView(R.id.ll_gzs)
    LinearLayout llGzs;


    @Override
    public int getLayoutRes() {
        return R.layout.activity_setting;
    }

    @Override
    public void onCreateActivity(@Nullable Bundle savedInstanceState) {
        initToolbar(UiUtils.getString(R.string.setting));
        if (AppUtils.getAppName(this).equals(getString(R.string.ssq_app_name))) {
            llHt.setVisibility(View.VISIBLE);
            llGzs.setVisibility(View.VISIBLE);
        } else {
            llHt.setVisibility(View.GONE);
            llGzs.setVisibility(View.GONE);
        }
        mTxtSlogan.setText(UiUtils.getString(R.string.app_name));
        mTxtVersion.setText("V".concat(AppUtils.getAppVersionName()));
        tvDesc.setText("极速借款平台");
    }


    @OnClick({R.id.cil_xys, R.id.cil_yss, R.id.cil_cns})
    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.cil_xys:
                StatisticsUtils.intentWebView(this,
                        Constants.XYS_HTML,getResources().getString(R.string.xys),"");
                break;
            case R.id.cil_yss:
                StatisticsUtils.intentWebView(this,
                        Constants.YSS_HTML,getResources().getString(R.string.yss),"");
                break;
            default:
                StatisticsUtils.intentWebView(this,
                        Constants.CNS_HTML,getResources().getString(R.string.cns),"");
                break;
        }


    }


}
